﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Baosight.ZNH.ZMCommon;
using Baosight.Platform.Core;
using System.Windows.Browser;
using Telerik.Windows.Controls;
using Telerik.Windows.Controls.GridView;

namespace Baosight.ZNH.ZMCS.UI.Download
{
    public partial class DownloadView : EFViewCmes
    {
        public DownloadView()
        {
            InitializeComponent();
        }

        /// <summary>
        /// 下载文件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DownLoad_HyperlinkButton_Click(object sender, RoutedEventArgs e)
        {
            HyperlinkButton link = sender as HyperlinkButton;
            EIRow row = (link.ParentOfType<GridViewRow>().Item as UIBaseEntity).GetEIRow();
            if (row["fdMemoryName"] != null)
            {
                Uri uri = Uploader.ConstructAbsoluteUri("../downloadpage.jsp?filename=" + HttpUtility.UrlEncode(HttpUtility.UrlEncode(row["fdMemoryName"].ToString())));
                HtmlPage.Window.Navigate(uri, "_blank");
            }

        }
    }
}
